package cn.wipace.actionlib.inter;

import android.content.Context;
import android.net.Uri;

import java.util.List;

import cn.wipace.actionlib.model.UserAction;
import cn.wipace.actionlib.model.UserScore;
import cn.wipace.actionlib.network.HttpResultListener;


/**
 * Created by Administrator on 2017/4/26.
 */

public interface UserInter {

    public final static String STACK_AUTHORITY = "cn.wipace.StackProvider";
    public final static String JELLY_AUTHORITY = "cn.wipace.JellyProvider";
    public final static String ICE_AUTHORITY = "cn.wipace.IceProvider";
    public final static String TOM_AUTHORITY = "cn.wipace.TomProvider";
    public static final String TABLE_NAME = "tbl_user_score";

    public final static Uri STACK_URIS = Uri.parse("content://" + STACK_AUTHORITY + "/" + TABLE_NAME);
    public final static Uri JELLY_URIS = Uri.parse("content://" + JELLY_AUTHORITY + "/" + TABLE_NAME);
    public final static Uri ICE_URIS = Uri.parse("content://" + ICE_AUTHORITY + "/" + TABLE_NAME);
    public final static Uri TOM_URIS = Uri.parse("content://" + TOM_AUTHORITY + "/" + TABLE_NAME);

    void saveUserActionData(float t0, float t1, float t2, float t3, float t4, float t5);

    void saveUserActionData(long userId, float t0, float t1,
                            float t2, float t3, float t4, float t5,
                            String packageName, long gameStartTime);

    List<UserAction> findUserActionData();

    void saveUserScoreData(long uid, float mindFullness, float exerciseAbility, float stressResponse,
                           float coordination, float gameScore, String packageName, short uploadResult,
                           long gameStartTime);

    void saveUserScoreData(long uid, float mindFullness, float exerciseAbility, float stressResponse,
                           float coordination, float gameScore, String packageName,
                           long gameStartTime);

    List<UserScore> findScoreTop10(long userId);

    List<UserScore> findScoreTop10(long userId, long gameStartTime);

    UserScore findLatestScore(long userId);

    void openRadarMapActivity(Context context, String packageName, UserScore score);

    List<UserAction> findUserActionByUidAndStartTime(long uid, long gameStartTime);

    void updateStackGameStatus(long scoreId, short gameStatus);

    //评估用户stack ABCD等级
    String stackEvaluateResult(UserAction userAction);

    //计算用户stack各项能力
    UserScore stackEvluateAbility(UserAction userAction);

    void uploadScoreData(UserScore score, HttpResultListener inter);

    void getScoreData(long uid, HttpResultListener inter);

    float getStackExerciseAbleScore(float gameScore);//获取stack运动能力得分结果

    String getStackScoreStr(float gameScore);//获得stack运动能力

    float getStackRespAbleScore(float gameScore);//获得stack反应能力得分

    float getStackMindAbleScore(float gameScore);//获得stack专注能力得分

    float getStackCoordAbleScore(float gameScore);//获得stack协调能力得分

    void resetConfiValue();

    String getTestValue();

    String getPreAftValue();

    UserScore getAvgScore(List<UserScore> userScores);


    /**
     * 四个游戏得分算法
     */
    double getFinalScore(int score);

    /**
     * 获得tom得分
     *
     * @param score
     * @return
     */
    double getTomScore(double score);

    void totalDuration(double duration);

    void resetDuartion();

    String showDuration();

    Uri saveScoreByProvider(Uri uri, String gameScore, Context context);

    List<UserScore> getScoreByProvider(Uri uri, Context context);

}
